package printpackage;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

public class Printsch extends Print{
    public String printDB(String date, String emp, int unuse1, int unuse2){
	    Connection conn = null;
	    PreparedStatement pstmt = null;
	    ResultSet rs = null;
	    String result = "";
		String modTarget = "schView.jsp";
		
        try {
            conn = getConnection();

            pstmt = conn.prepareStatement("select * from SCHEDULE where schDATE = ? and empID = ?");
            pstmt.setString(1, date);
            pstmt.setString(2, emp);
            rs = pstmt.executeQuery();
            while(rs.next())
               	result = result + "<br>" 
               	+ "<a href=javascript:schedule(\""+ modTarget +"?NO="+ rs.getInt("schNO") +"\")>" + rs.getString("schNAME") +" </a>";
                
            return result;
	        
        } catch(SQLException ex) {
            //throw new ScheduleManagerException("print schedule", ex);
        } finally {
            if (rs != null) try { rs.close(); } catch(SQLException ex) {}
            if (pstmt != null) try { pstmt.close(); } catch(SQLException ex) {}
            if (conn != null) try { conn.close(); } catch(SQLException ex) {}
        }
        return null;
    }
    
    public String printPage(String select, String search, int order, int page){
    	return null;
    }
    
    public String printTask(String empID){
    	return null;
    }
}